import { ref} from 'vue'
import { defineStore } from 'pinia'
import { getCategory } from '@/apis/layout';

export const useCategoryStore = defineStore('category', () => {
    //state
    const categoryList = ref([]);
    //action 方法
    const getcategory = async () => {
      const res = await getCategory();
      categoryList.value = res.result;
    };
    return{
        categoryList,
        getcategory
    }
})
